package com.testing.class15;

import com.testing.inter.InterKeyWord;

/**
 * @Classname SoapTest
 * @Description 类型说明
 * @Date 2022/11/7 21:55
 * @Created by 特斯汀Roy
 */
public class SoapTest {
    public static void main(String[] args) {
        InterKeyWord inter =new InterKeyWord();
        inter.saveParam("url","http://www.testingedu.com.cn:8081/inter/SOAP?wsdl");
        //auth接口
        inter.testPostXml("{url}","<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:soap=\"http://soap.testingedu.com/\"><soapenv:Header/><soapenv:Body><soap:auth></soap:auth></soapenv:Body></soapenv:Envelope>");
//        inter.saveRegexReqParam("tokenValue","\"token\":\"(.*?)\"");
//        inter.saveJsonParam("tokenValue",inter.saveRegexReqParam("authResp","<return>(.*?)</return>"),"$.token");
        inter.saveRegexParam("tokenValue","\"token\":\"(.*?)\"");
        System.out.println(inter.paramMap);
        inter.addHeader("{\"token\":\"{tokenValue}\"}");
        //登录接口
        inter.testPostXml("{url}","<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:soap=\"http://soap.testingedu.com/\"><soapenv:Header/><soapenv:Body><soap:login><arg0>Will</arg0><arg1>123456</arg1></soap:login></soapenv:Body></soapenv:Envelope>");
        inter.saveRegexParam("idValue","\"userid\":\"(.*?)\"");
        //用户信息接口
        inter.testPostXml("{url}","<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:soap=\"http://soap.testingedu.com/\"><soapenv:Header/><soapenv:Body><soap:getUserInfo><arg0>{idValue}</arg0></soap:getUserInfo></soapenv:Body></soapenv:Envelope>");



    }
}
